home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 6.6 KB | 182 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Finder.Lib
- #
- # Contains: xxx put contents here xxx
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1+> 5/21/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "LaunchQuit.Lib", "StandardFile.Lib","UserInterface.Lib";
-
- #########################################################################
- # HelpBalloons( n )
- #========================================================================
- # Author: KTA
- # Description: Turns Help Balloons ON/OFF
- # Parameters: 0 - To turn Help Balloons - OFF
- # 1 - To turn Help Balloons - ON
- # 2 - To toggle the Hide Balloons/Show Balloons
- # Returns: Nothing
- # Examples: HelpBalloons( 0 );
- # Assumptions: 7.0x only!
- #========================================================================
- # History:
- #
- #########################################################################
- TASK HelpBalloons( n := 2 ) begin
- if ( n = 2 ) #To select the HIDE/SHOW Balloons
- SelectMenuItem(/≈Balloons/,"");
-
- else begin
- ShowBalloons := match[menuitem t:"Show Balloons" m:[menu o:7]];
- HideBalloons := match[menuitem t:"Hide Balloons" m:[menu o:7]];
-
- if ( n = 1 ) begin #To make insure Help Balloons is on
- if (ShowBalloons)
- SelectMenuItem("Show Balloons","");
- Else
- LogStr("Help Balloons currently running");
- end;
- else if ( n = 0 ) begin #To make insure Help Balloons is off
- if (HideBalloons)
- SelectMenuItem("Hide Balloons","");
- Else
- LogStr("Help Balloons currently disabled");
- end;
- end;
- end;
-
- #########################################################################
- # FinderNavigate( PathList, OpenFlag )
- #========================================================================
- # Author: Kevin Avoy (ext. 45604)
- # Description: Navigates in the Finder by typing. FinderNavigate insures
- # that Finder is the current app and closes all windows.
- # Then he types each item in Pathlist to select the next folder
- # and Command-'O' to open the selected folder.
- # Parameters: PathList := List of directories to open delimited by commas.
- # OpenFlag := Set to 1 to select Comand-'O' for each directory
- # in the Pathlist. If this is not true than only
- # the first item of pathlist will be typed. Use 0
- # to navigate to disks on desktop without opening.
- # Returns: nada - No way to check - cross your fingers
- # Examples: FinderNavigate({"HD","Folder1","Folder2"};
- # Assumptions: Keyboard repeat rate must be off to type navigate successfully.
- #========================================================================
- # History:
- #
- #########################################################################
- TASK FinderNavigate(PathList := {},OpenFlag := 1) begin
- tempTypeSpeed := TypeSpeed(50);
- Println "------ Were Navigating in the Finder -------";
- LaunchTwitch('Finder');
- KeyEq('w',2); # Closes all Finder Windows Command-Option-w
- Wait(4);
- If not(OpenFlag)
- TypeStr(Pathlist[1]); # If not select open only type the first item
- else
- begin
- for each item in Pathlist
- begin
- TypeStr(item); # Types the names in the path
- keyEq('o'); # Selects open
- end;
- end;
- TypeSpeed(tempTypeSpeed);
- end; # FinderNavigate()
-
- #########################################################################
- # ShimmerMateCopy( Source, Dest )
- #========================================================================
- # Author: Kevin Avoy (ext. 45604)
- # Description: Opens ShimmerMate and copies the specified file from
- # Source -> Destination. (ShimmerMate is an internal
- # Apple Tool for performing Finder operations using VU)
- # Parameters: Source[1] := Pathlist for source document
- # Source[2] := Flag for Standard File navigation
- # Dest[1] := Pathlist for Destination including new unique document
- # name.
- # Dest[2] := Flag for Standard File navigation
- #
- # Pathlist: List of directories followed by the filename
- # delimited by commas.
- # Flag:
- # 1 - Navigate using Standard File.
- # 0 - Type in path and filename delimited by ':'s.
- # Returns: 0 := Failure
- # 1 := Success
- # Example: ShimmerMateCopy({{"HD","Folder1","MacPaint"},1},{{"My_Floppy","MacPaint"},0});
- # - ShimmerMateCopy[1]; will use Standard File
- # - ShimmerMateCopy[2]; will type the path.
- # Assumptions: Shimmermate (or Alias) is in the Apple Menu.
- # Paths are correct.
- # There is room on the Destination disk (Shimmermate doesn't check)
- #========================================================================
- # History:
- #
- #########################################################################
- TASK ShimmerMateCopy(Source := {{},1}, Dest := {{},1})
- begin
- temp := Global gAppVerify;
- gAppVerify := 0;
- Launchtwitch('ShimmerMate'); # Assumes an alias to Shimmermate is in the Apple Menu.
- Wait(5);
- if (match[window t:'ShimmerMate' o:1]!)
- begin
- LogStr("------ Were ShimmerMatin' it!!! ------",4);
- selectRadioButton('Copy');
- SelectFileButtons := Collect[button t:"Select File"]; # There are 2 buttons with the same name
- if (Source[2]) #If we use Standard File
- begin
- Select SelectFileButtons[2]; # Top button is ord 2
- LogStr("Selected the top 'Select File' button");
- wait(2);
- SFNavigate(Source[1]);
- SpecialKey(tabkey,"Tab Key");
- end;
- else # Type the path
- begin
- TypeList(Source[1],':');
- SpecialKey(tabkey,"Tab Key");
- end;
-
- if (Dest[2]) #If we use Standard File
- begin
- Select SelectFileButtons[1]; #Bottom button is ord 1
- LogStr("Selected the bottom 'Select File' button");
- wait(2);
- SFNavigate(Dest[1]);
- end;
- else # Type the path
- TypeList(Dest[1],':');
- if not(selectButton("Do it"))
- Return(0);
- while(match[button t:'Do It' e:true]!); # Disabled 'Do it' button is indicates completion.
- selectButton("Quit"); # Quit Shimmermate
- gAppVerify := temp;
- return(1);
- end;
- else
- begin
- LogStr("!@#$% Sorry, ShimmerMate is not running");
- gAppVerify := temp;
- return(0);
- end;
- end; # ShimmerMateCopy()